$def with (work)

$jsdef render_lazy_work_preview(work):
    <div class="ac_work" title="$_('Select this work')">
        <div class="cover">
            $if work['cover_i']:
                <img
                    src="https://covers.openlibrary.org/b/id/$(work['cover_i'])-M.jpg"
                    alt="$_('Cover of: %(title)s', title=work['title'])"
                    loading="lazy"
                >
        </div>
        <div class="olid">$work['key']</div>
        <span class="name">
            <span class="title">$work['full_title']</span>
            $if 'first_publish_year' in work:
                <span class="first_publish_year">($work['first_publish_year'])</span>
        </span>
        <span class="byline">
            $if work['author_name']:
                $_('by') <span class="authors">${', '.join(work['author_name'])}</span>
        </span>
        &bull;
        $if work['edition_count'] == 1:
            <span class="edition_count">$_("1 edition")</span>
        $else:
            <span class="edition_count">$work['edition_count'] $_("editions")</span>
        <div class="clear"></div>
    </div>

$if work:
    $:render_lazy_work_preview(work)